package xyz.mimai.media.netty.tcp.resolve;

import io.netty.util.CharsetUtil;


/**
 * @ClassName MessageUnit
 * @Description 数据传输包单元
 * @Author 方丈
 * @Date 2021/2/23 10:26
 * @Version 1.0.0
 **/
public class MessageUnit {
    int length;
    byte[] content;

    public MessageUnit(int length, byte[] content) {
        this.length = length;
        this.content = content;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public byte[] getContent() {
        return content;
    }

    public void setContent(byte[] content) {
        this.content = content;
    }

    @Override
    public String toString() {
        return "MessageUnit{" +
                "length=" + length +
                ", content=" + new String(content, CharsetUtil.UTF_8) +
                '}';
    }
}
